<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <script>
        for(var i = 1000 ; i <= 9999 ; i++){
            var ge = i % 100,
                shi = parseInt(i / 100) % 10;
                bai = parseInt(i / 1000);
            var sum = ge * ge * ge * ge + shi * shi * shi * shi + bai * bai * bai * bai;
            if(sum == i){
                console.log(sum);  
            }
             
        }
    </script>
</head>
<body>
    
</body>
</html>